//
//  YYDefinition.h
//  MoviesInfo
//
//  Created by zhangkai on 2023/4/22.
//  Copyright © 2023 Tobias Ruano. All rights reserved.
//

#ifndef YYDefinition_h
#define YYDefinition_h

#define KISDictionaryHaveKey(dict,key) [[dict allKeys] containsObject:key] && ([dict objectForKey:key] != (NSString*)[NSNull null]) ? [dict objectForKey:key] : @""
//block修饰
#define weakSelf(weakSelf)  __weak __typeof(&*self)weakSelf = self;
#define kMainScreenSize [UIScreen mainScreen].bounds.size
#define kScreenW [UIScreen mainScreen].bounds.size.width
#define kScreenH [UIScreen mainScreen].bounds.size.height



#define KcolorHex(HexStr)    [UIColor colorWithHexString:HexStr]
#define Kcolor(r,g,b,l) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:l]


#define kWindow [UIApplication sharedApplication].keyWindow
#define kCurrentNavgationController kWindow.visibleViewController.navigationController
#define kNavgationBarHeight 44
#define kTabBarBottomSecurityH ([[UIApplication sharedApplication] statusBarFrame].size.height>20?34:0)
#define kTopHeight (kStatusBarHeight + kNavgationBarHeight)
#define kTabBarHeight ([[UIApplication sharedApplication] statusBarFrame].size.height>20?83:49)
#define kStatusBarHeight [UIApplication sharedApplication].statusBarFrame.size.height
#define State_Bar_H ((![[UIApplication sharedApplication] isStatusBarHidden]) ? [[UIApplication sharedApplication] statusBarFrame].size.height : (IS_IPHONEX_SET ? 44.f : 20.f))
#define DT_IS_IPHONEX_XS (kScreenH == 812.f)//是否是iPhoneX、iPhoneXS
#define DT_IS_IPHONEXR_XSMax (kScreenH == 896.f)//是否是iPhoneXR、iPhoneX Max
#define IS_IPHONEX_SET (DT_IS_IPHONEX_XS||DT_IS_IPHONEXR_XSMax)//是否是iPhoneX系列手机





#endif /* YYDefinition_pch */

